<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>物资基本信息</title>
		<link rel="stylesheet" type="text/css" href="../../css/style.css" />
		<link rel="stylesheet" type="text/css" href="../../css/list.css" />
		<link rel="stylesheet" type="text/css" href="../../css/layui.css"/>
		<style type="text/css">
			.input_radio2 {
				width: 300px;
				height: 300px;
				text-align: center;
				position: absolute;
				top: 50%;
				left: 50%;
				margin-left: -150px;
				margin-top: -100px;
				background: rgb(245, 245, 245);
				border: 1px solid rgb(200, 200, 200);
				box-shadow: 5px 5px 5px rgb(100, 100, 100);
			}
			
			.input_radio2 p {
				text-align: center;
				height: 30px;
				background: rgb(68, 161, 248);
				line-height: 30px;
				color: white;
				margin-bottom: 25px;
			}
			
			.input_radio2 p {
				text-align: center;
				height: 30px;
				background: rgb(68, 161, 248);
				line-height: 30px;
				color: white;
				margin-bottom: 25px;
			}
			
			.input_radio2 .fs-wrap {
				width: 200px;
			}
		</style>
	</head>

	<body>
		<!-- 蓝色背景区域 -->
		<div class="wrap">
			<!-- 白色可用区域 -->
			<div class="canuse">
				<!------ 位置 ------>
				<p class="contentText local"><span>位置：基础信息管理 > 物资基本信息</span></p>

				<!-- 搜索区 -->
				<div class="search_area">
					<h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>物资基本信息查询条件</span></h4>
					<div class="select_area">
						<div class="select_text clear">
							<div class="label_input">
								<label class="contentText">物资编码：</label> <input type="text" name="" id="code" ">
                        	</div>
                        	<div class="label_input ">
	                            <label class="contentText ">物资名称：</label> <input type="text " name=" " id="name ">
                        	</div>
                        	<div class="label_input ">
	                            <label class="contentText ">物资类型：</label> <select id="type ">
	                            	<option>--请选择--</option>
	                            	<option>类型1</option>
	                            	<option>类型1</option>
	                            	<option>类型1</option>
	                            </select>
                        	</div>
                            <div class="floatLeft ">
	                            <button class="btn_search bgd_blue_search " onclick="onSearch() ">查询</button>
	                            <button class="btn_clear bgd_white_clear " onclick="clearSearch() ">重置</button>
                            </div>
                        </div>
                    </div>
	            </div>
	            
	            <!-- 列表区 -->
	            <div class="show_list ">
                	<div class="title_operate ">
                    	<h4 class="sel_title "><img src="../../img/list/brand1.png " /><span>物资信息列表</span></h4>
                    	<!-- 操作类型区 -->
                        <div class="operate_area ">
                            <a id=" " href="material-info-add.html " class="bgd_add img_hand ">增加</a>
                            <a id="del" class="bgd_delete img_hand ">删除</a> 
                            <a class="bgd_export img_hand" id="downloadEBOMTemplate">模板</a>
                       		<a id="exportOrder" class="bgd_import img_hand ">导入</a>
                        </div>
                	</div>
                	<div class="list_area ">
                        <!-- 信息列表区 -->
                        <div class="info_area ">
                            <table class="tablelist " border="1 " cellspacing="0 " cellpadding="0 " id="tablelist ">
                                <tbody>
                                    <tr class="menuText list_head ">
                                        <th class="checkSelectAll "></th>
                                        <th>序号</th>
                                        <th>物资编码</th>
                                        <th>物资名称</th>
                                        <th>物资类型</th>
                                        <th>规格型号</th>
                                        <th>计量单位</th>
                                        <th>是否有效期</th>
                                        <th>所属仓库</th>                                     
                                    </tr>
                                </tbody>
                                <tbody class="tablelist ">
                                    <tr class="listTableText list_list ">
                                        <td><input type="checkbox" class="input_checkBox" name="" id="ids" value=""></td>
                                        <td>1</td>
                                        <td><a href="material-info-add.html " style="color:blue ">BM001</a></td>
                                        <td>SM002</td>
                                        <td>TYPE</td>
                                        <td>model</td>
                                        <td>个</td>
                                        <td>否</td>
                                        <td>盘装物资库</td>
                                        
                                    </tr>
                                    <tr class="listTableText list_list ">
                                        <td><input type="checkbox" class="input_checkBox" name="" id="" value=""></td>
                                        <td>2</td>
                                         <td><a href="material-info-add.html " style="color:blue ">BM002</a></td>
                                        <td>AJ002</td>
                                        <td>TYPE</td>
                                        <td>model</td>
                                        <td>个</td>
                                        <td>否</td>
                                        <td>盘装物资库</td>
                                    
                                    </tr>
                                    <tr class="listTableText list_list ">
                                        <td><input type="checkbox" class="input_checkBox " name=" " id=" " value=" "></td>
                                        <td>3</td>
                                         <td><a href="material-info-add.html " style="color:blue ">BM003</a></td>
                                        <td>002</td>
                                        <td>TYPE</td>
                                        <td>model</td>
                                        <td>个</td>
                                        <td>否</td>
                                        <td>盘装物资库</td>
                                    
                                    </tr>
                                    <tr class="listTableText list_list ">
                                        <td><input type="checkbox" class="input_checkBox " name=" " id=" " value=" "></td>
                                        <td>4</td>
                                         <td><a href="material-info-add.html " style="color:blue ">BM004</a></td>
                                        <td>XX002</td>
                                        <td>TYPE</td>
                                        <td>model</td>
                                        <td>个</td>
                                        <td>否</td>
                                        <td>盘装物资库</td>
                                
                                    </tr>
                                    <tr class="listTableText list_list ">
                                        <td><input type="checkbox" class="input_checkBox " name=" " id=" " value=" "></td>
                                        <td>5</td>
                                        <td><a href="material-info-add.html " style="color:blue ">BM005</a></td>
                                        <td>MK002</td>
                                        <td>TYPE</td>
                                        <td>model</td>
                                        <td>个</td>
                                        <td>否</td>
                                        <td>盘装物资库</td>
                                  
                                    </tr>
                                    <tr class="listTableText list_list ">
                                        <td><input type="checkbox" class="input_checkBox " name=" " id=" " value=" "></td>
                                        <td>6</td>
                                        <td><a href="material-info-add.html "  style="color:blue ">BM006</a></td>
                                        <td>OM002</td>
                                        <td>TYPE</td>
                                        <td>model</td>
                                        <td>个</td>
                                        <td>否</td>
                                        <td>盘装物资库</td>
                              
                                    </tr>
                                    
                                </tbody>

                            </table>
                        </div>
	                    <!-- 页码区域 -->
	                    <div class="page_area contentText clear ">
	                    	<div class="page_sum ">
	                    		共<span class="page_number "> 3 </span>页&emsp;每页 <select style="width: 40px; "><option>10</option><option>20</option><option>30</option><option>50</option></select> 条&emsp;共<span class="info_sum "> 27 </span>条记录
	                    	</div>
	                        <div class="page_jump ">
	                        	<span>跳转到&emsp;第</span>
	                        	<input type="text " name=" " id=" " value="1 " />
	                        	<span>页&emsp;</span>
	                        	<button>Go</button>
	                        </div>
	                        <div class="page-pull-right async-page ">
	                            <button>上一页</button>
	                            <button class="select_page ">1</button>
	                            <button>2</button>
	                            <button style="color: rgb(30, 30, 30); ">▪▪▪</button>
	                            <button>9</button>
	                            <button>10</button>
	                            <button>下一页</button>
	                        </div>
	                    </div>
                    </div>
                </div>
			</div>
			
			<!-- 版尾  -->
			<!--<div class="ending currentYear "></div>-->
			
			<!--导入弹框-->		
			<div id = "exportBOMDiv" class="mask hidden">
			<div class="input_radio2">
				<p>导入物资基本信息</p>
				<div id = "popWindow">
					请选择：<input type="file" id="productTechnologyInput" >
				</div>
				<div style="position: absolute;bottom: 10px;left: 75px;">
					<input class="bgd_blue_two img_hand contenText" type="button" value="提交" onclick="exportBOMFile()">
					<input class="bgd_blue_two img_hand contenText" type="button" value="取消" onclick="cancel()">
				</div>
			</div>
		</div>
		
			
			<!-- 等待加载 -->
			<!--<div class="loader "><p class="load_hint ">请等待加载••••••</p></div>-->
			
		</div>
	</body>
	<script src="../../js/jquery-3.1.1.min.js " type="text/javascript " charset="utf-8 "></script>
	<script src='../../js/common/common.js' type='text/javascript' charset='utf-8'></script>
		<script src="../../js/frame/common.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/layui.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript ">
		var h = document.documentElement.clientHeight;
		$(".wrap ").css("height ", h);
		
		// 获取每行 td 的兄弟节点
		$("td ").hover(   
			function () {      
				$(this).parent().children().addClass("td_hover ");   
			},    
			function () {      
				$(this).parent().children().removeClass("td_hover ");   
			}
		);
		
		// 点击下载EBOM模板
		$("#downloadEBOMTemplate").click(function() {
			alert("下载物资基础信息模板");
		});
		
			// 导出Excel
		
		$("#exportOrder").click(function(){
			$("#exportBOMDiv").css("display", "block");
		});
		
		
		// 导入				
		function exportBOMFile(){
			$("#exportBOMDiv").css("display", "none");
		}
		
		//弹框点击取消
		function cancel(){
			$("#exportBOMDiv").css("display", "none");
		}
		
		$("#del").click(function(){
			 var list = [];
	        var checks = $("input[type='checkbox']:checked");
	        $.each(checks, function(index, obj) {
	            list.push(obj.id);
	        });
	        if (!list.length > 0) {
	            alert("请选择要删除的内容 ");
	            return;
	        }
	        if (!confirm("确定要删除吗？ ")) {
	            return;
	        }
	        alert("删除成功");
		});
		//删除规则
	    function delUserGroup() {
			
	        var list = [];
	        var checks = $("input[name='ids' ]:checked ");
	        $.each(checks, function(index, obj) {
	            list.push(obj.id);
	        });
	        if (!list.length > 0) {
	            alert("请选择要删除的内容 ");
	            return;
	        }
	        if (!confirm("确定要删除吗？ ")) {
	            return;
	        }
	        alert("提醒:删除时，正在使用的将无法删除！ ");
	        $.ajax({
	            type : 'POST',
	            url : 'userGroup/delUserGroup',
	            data : JSON.stringify(list),
	            contentType : 'application/json; charset=utf-8',
	            async : true,
	            cache : false,
	            success : function(data) {
	                alert(data == 'success' ? "删除成功 " : "被使用：无法删除!!! ");
	                if (data != 'success') {
	                    return;
	                }
	
	                var current = PageUtils._currentPage['userGroupPage'];
	                PageUtils.pageClick(current, 'userGroupPage');
	            }
	
	        });
		}
		
		function onSearch(searchContent){

			var code = $("#code ").val();
			var name = $("#name ").val();
			var storeId = document.getElementById('tablelist');//获取table的id标识  
			var rowsLength = storeId.rows.length;//表格总共有多少行  
			for(var i=1;i<rowsLength;i++){//按表的行数进行循环，本例第一行是标题，所以i=1，从第二行开始筛选（从0数起）  
					
				var codeSearchText = storeId.rows[i].cells[2].innerHTML;//取得table物资编码列的值  
				var nameSearchText = storeId.rows[i].cells[3].innerHTML;//取得table物资名称列的值

				if((codeSearchText.match(code) || codeSearchText.toUpperCase().match(code.toUpperCase())) && (nameSearchText.match(name) || nameSearchText.toUpperCase().match(name.toUpperCase()))){//用match函数进行筛选，如果input的值，即变量 key的值为空，返回的是ture，  
					storeId.rows[i].style.display='';//显示行操作，  
				}else{  
					storeId.rows[i].style.display='none';//隐藏行操作  
				}  
			}  
 
        }   
        
        function clearSearch(){
        	$("#code ").val(" ");
			$("#name ").val(" ");
        	$("#type ").prop('selectedIndex', 0);
        	onSearch();
        }
	</script>
</html>